<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>在线OJ-题目列表</title>
    <link href="https://fonts.googleapis.com/css2?family=Poppins:wght@300;400;600&family=Roboto:wght@400;700&display=swap" rel="stylesheet">
    <style>
        /* 全局样式 */
        * {
            margin: 0;
            padding: 0;
            box-sizing: border-box;
            font-family: 'Poppins', sans-serif;
        }

        body {
            background-color: #f5f7fa;
            color: #333;
            line-height: 1.6;
        }

        .container {
            width: 90%;
            max-width: 1000px;
            margin: 0 auto;
            padding-top: 80px; /* 避免内容被导航栏遮挡 */
            text-align: center; /* 使内容居中 */
        }

        /* 导航栏样式 */
        .navbar {
            width: 100%;
            background-color: #fff;
            box-shadow: 0px 2px 4px rgba(0, 0, 0, 0.1);
            position: fixed;
            top: 0;
            left: 0;
            z-index: 1000;
            padding: 15px 20px;
            display: flex;
            justify-content: center; /* 导航栏字样居中 */
            align-items: center;
            letter-spacing: 0.5px; /* 优化字间距 */
        }

        .navbar a {
            text-decoration: none;
            color: #333;
            margin-left: 15px; /* 缩小间距 */
            font-size: 16px;
            position: relative;
        }

        .navbar a:hover {
            color: #4CAF50;
        }

        .navbar a::after {
            content: '';
            display: block;
            width: 0;
            height: 2px;
            background: #4CAF50;
            transition: width .3s;
            position: absolute;
            bottom: -5px;
            left: 0;
        }

        .navbar a:hover::after {
            width: 100%;
        }

        .navbar .logo {
            font-size: 24px;
            font-weight: 700;
            color: #4CAF50;
            text-transform: uppercase;
            letter-spacing: 1px; /* 调整字母间距 */
            margin-right: auto; /* 使logo与导航栏中的链接保持距离 */
        }

        /* 表格样式 */
        .question_list {
            margin-top: 40px;
            max-width: 100%;
        }

        .question_list h1 {
            font-family: 'Roboto', sans-serif;
            font-size: 24px;
            margin-bottom: 20px;
            color: #4CAF50;
            text-align: center; /* 标题居中 */
        }

        table {
            width: 100%;
            max-width: 800px; /* 限制表格的最大宽度 */
            margin: 0 auto; /* 居中表格 */
            border-collapse: collapse;
            margin-bottom: 20px;
            background-color: #fff;
            box-shadow: 0px 2px 4px rgba(0, 0, 0, 0.1);
        }

        th, td {
            padding: 15px;
            text-align: center; /* 表格内容居中 */
            border-bottom: 1px solid #ddd;
        }

        th {
            background-color: #f2f2f2;
            font-weight: 600;
            color: #333;
        }

        td a {
            color: #4CAF50;
            text-decoration: none;
        }

        td a:hover {
            text-decoration: underline;
        }

        h4 {
            margin-top: 30px;
            font-weight: 300;
            font-size: 14px;
            color: #888;
            text-align: center;
        }

        /* 响应式设计 */
        @media (max-width: 768px) {
            .navbar {
                flex-direction: column;
                align-items: center; /* 小屏幕时居中导航栏字样 */
            }

            .navbar a {
                margin: 10px 0;
            }

            .navbar .menu-toggle {
                display: block;
                cursor: pointer;
            }

            .navbar a {
                display: none;
                width: 100%;
            }

            .navbar.active a {
                display: block;
                text-align: left;
                padding: 10px 0;
                margin: 0;
                border-bottom: 1px solid #ddd;
            }
        }
    </style>
</head>
<body>
    <div class="container">
        <div class="navbar">
            <span class="logo">OJ Platform☰</span>
            <a href="/bch">首页</a>
            <!-- <a href="/all_questions">题库</a> -->
        </div>
        <div class="question_list">
            <h1>OnlineJudge题目列表</h1>
            <table>
                <tr>
                    <th class="item">题目编号</th>
                    <th class="item">题目名称</th>
                    <th class="item">题目难度</th>
                </tr>
                {{#question_list}}
                <tr>
                    <td class="item">{{number}}</td>
                    <td class="item"><a href="/question/{{number}}">{{title}}</a></td>
                    <td class="item">{{star}}</td>
                </tr>
                {{/question_list}}
            </table>
        </div>
        <h4>@毕财华 2623233865@qq.com</h4>
    </div>

    <script>
        document.querySelector('.menu-toggle').addEventListener('click', function() {
            document.querySelector('.navbar').classList.toggle('active');
        });
    </script>
</body>
</html>